package com.xinchao.dao;

import com.xinchao.model.AsstTravelRecord;
import com.xinchao.model.dto.RouteInfoDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 路单表Mapper
 * @Author: xp630
 */
public interface AsstTravelRecordMapper {
    int deleteByPrimaryKey(Long trvavelRecordId);

    int insert(AsstTravelRecord record);

    int insertSelective(AsstTravelRecord record);

    AsstTravelRecord selectByPrimaryKey(Long trvavelRecordId);

    int updateByPrimaryKeySelective(AsstTravelRecord record);

    int updateByPrimaryKey(AsstTravelRecord record);

    void deleteByUser(@Param("userId") Long userId);

    /**
     * 删除对应城市下的路单信息
     * @param routeId 路线version
     * @param cityCode 城市编码
     */
    void deleteByRoute(@Param("routeId")Long routeId,@Param("cityCode")String cityCode);

    /**
     * 批量插入路单关系
     * @param records
     */
    void batchInsert(@Param("records") List<AsstTravelRecord> records);

    List<AsstTravelRecord> selectByUserId(@Param("userId") Long userId);

    List<RouteInfoDTO> getRouteInfoList(@Param("routeName") String routeName, @Param("userName") String userName, @Param("cityCode") String cityCode);
}